package im.xz.cn.xiacore.menu.mainMenu;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;

public class openMenu implements Listener {
    @EventHandler
    public void a(PlayerInteractEvent event) {
        try {
            if (event.getPlayer().getInventory().getItemInMainHand().getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.LIGHT_PURPLE + "游戏菜单")) {
                event.setCancelled(true);
                event.getPlayer().performCommand("menu");
            } else {

            }
        }catch (NullPointerException ignore) {

        }
    }
}